;(function(FormBase) {
    FormBase.Password = FormBase.extend({
        msgObj: { // error msg
            PWD_NO_SPACE: "密码不能包含空格",
            PWD_MORE_16: "6~16位的字符，可由英文、数字或符号构成 ",
            NOT_VALIDE: "非法字符！"
        },
        susFun: function() {},
        errFun: function() {},
        checkForm: function() {
            var regpwd = /[@#\$%\^&\*]+/g;
            var regs = /\s/;
            if (regs.test(this.newValue)) { //含有空格
                return {
                    status: false,
                    msg: this.getMsg("PWD_NO_SPACE"),
                    value: this.newValue.replace(/(^\s*)|(\s*$)/g, "")
                };
            } else if (this.newValue.length > 16) { //长度超过16位
                return {
                    status: false,
                    msg: this.getMsg("PWD_MORE_16"),
                    value: this.newValue.substring(0, 16)
                };
            } else if (regpwd.test(this.newValue)) {
                return {
                    status: false,
                    msg: this.getMsg("NOT_VALIDE"),
                    value: this.newValue
                }
            }

            if (this.newValue.length > 5) { //密码至少6位
                return {
                    status: true,
                    msg: null,
                    value: this.newValue
                };
            } else {
                return {
                    status: false,
                    msg: this.getMsg("PWD_MORE_16"),
                    value: this.newValue
                };
            }
        }

    });
})(window.FormBase = window.FormBase || {})
